<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="./styles/index.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1577286_ydx8guo479f.css">
    <script src="./javascripts/libs/jquery.min.js"></script>
    <script src="./javascripts/libs/public.js"></script>
    <link rel="stylesheet" href="./styles/cart_dis.css">

</head>

<body>
    <!-- 顶部通版区 -->
    <div class="ding-tong">
        <div class="ding-safe">
            <ul>
                <li> 欢迎进入钻石小鸟官网</li>
                <li> <a href="login.html">登录</a></li>
                <li><a href="register.html">注册</a></li>
            </ul>

            <dl>
                <dd>
                    MemberOfZbird
                </dd>
                <dd>
                    <span></span>
                </dd>
                <dd class="signout">
                    <a href="">退出登录</a>
                </dd>
            </dl>
            <script>
                var timer = new Date()
                var hour = timer.getHours()
                if (hour <= 12 && hour > 0) {
                    $('dl dd span').html('上午好:')

                }
                if (hour > 12 && hour <= 18) {
                    $('dl dd span').html('下午好:')
                }
                if (hour > 18 && hour < 24) {
                    $('dl dd span').html('晚上好:')
                }
            </script>
            <script>
                var cookie_string = getCookie("USR");
                var nav_list = document.querySelector(".ding-safe ul");
                var user_name = document.querySelector(".ding-safe dl");
                try {
                    // 因为在这里存在报错的可能,所以尽量把这段代码放在try catch里面;
                    var cookie_array = JSON.parse(cookie_string);
                    user_name.className += " active";
                    // user_name.innerHTML = cookie_array.username;
                } catch (e) {
                    // 一旦 catch 则表示登陆状态不正确;
                    nav_list.className += " active";
                }

                // 退出登陆;         
                var signout = document.querySelector(".signout");
                signout.onclick = function () {
                    removeCookie("USR", "/");
                    location.onload();
                };
            </script>

            <p>
                <img src="http://img.zbird.cn/ww3/pubheaderfooter/header_box.png" alt="">
                <a href="./carts.html">购物车</a>
                <span class="count" style="color:#ff8a81;">0</span>
                <i class="iconfont icon-xiajiantou"></i>
            </p>
            <ol>
                <li>我的订单</li>
                <li>我的鸟巢</li>
                <li>钻石课堂</li>
                <li>手机官网</li>
            </ol>
        </div>
    </div>
    <header>
        <div class="header-safe">
            <div class="logo">
                <a href="./index.html">
                    <img src="http://im1.zbird.cn/picdb/555/518/f6aa96185bbd30da859cc7278a7d1d4a.png" alt="">
                </a>
            </div>

            <div class="biaoyu">
                <img src="http://img.zbird.cn/ww3/pubheaderfooter/pcslogan.png" alt="">
            </div>


            <p>
                <a href="" class="btn">
                </a>
            </p>

            <div class="search">
                <input type="text">
                <a href=""></a>

            </div>
        </div>
    </header>

    <div class="bg_pic">

        <div class="msg">
            <h4>我的购物车</h4>
            <p>
                你的购物车内暂时没有商品，去首页挑选喜欢的商品
            </p>

            <button class="log">
                <a href="./index.html">去首页</a>
            </button>


        </div>
    </div>

    <script>
        $('.log').click(function () {
            location.assign('./login.html')
        })

        $('.goindex').click(function () {
            location.assign('./index.html')
        })
    </script>

</body>

</html>